<script language="javascript" type="text/javascript">

function __Nivel(nivel)
{
	var get = document.getElementById('niveles');
	if(get.selectedIndex>=0){
		if(nivel=='0' && get.selectedIndex!='0'){
			get.selectedIndex=get.selectedIndex-1;
			}
		else if(nivel=='1' && get.selectedIndex!='3'){
			get.selectedIndex=get.selectedIndex+1;
			}
	}
}
</script>
<div id="container">
<!--Menu Izquierdo-->
  <div id="side-menu" class="left">
<div id="menu-bar">
      <div class="title">Proyecto</div>
          <div id="options">
          <div><?php echo anchor('planing/scheme','Armar');?></div>
          <div><?php echo anchor('planing/search','Buscar Plan');?></div>
          </div>
      </div>
  </div>
  <!--Fin Menu Izquierdo-->
  <!--Inicio Contenedor-->
  <div id="content" class="right">
            <div id="subtitle">
        	  <h2>Proyecto</h2>
				<div id="task">Empresa</div>
        	</div>
            <!-- Contenido -->
        <div id="text-field">
        <br />

        <?php 
		//if(!is_int($seleccionado)){ // si noes entero
		//$fecha=strftime( "%Y/%m/%d %H:%M", time() );
		$ss=array('name'=>'form1');
		echo form_open('planing/scheme',$ss);
		?>
        <input name="proyecto" id="proyecto" type="hidden" value="<?php echo "51";?>" />
        <input name="tarea" id="tarea" type="hidden" value="<?php echo "0";?>" />
        <div id="controls" >
        <table width="680" border="0">
  <tr>
    <td width="78"><input type="submit" value="sacar" name="sacar" id="sacar" /></td>
    <td width="100"><input type="text" name="valor" id="valor" value="<?php echo $valor;?>"  size="15" /></td>
    <td width="69">EDICION</td>
    <td width="72">&nbsp;</td>
    <td width="66"><input type="submit" value="Mostrar" name="mostrar" id="mostrar" /></td>
    <td width="85"></td>
    <td  width="37">&nbsp;</td>
    <td width="78">&nbsp;</td>
    <td width="57">&nbsp;</td>
    
    </tr>
  <tr>
    <td>nombre</td>
    <td>
      <label>
        <input type="text" name="nombre" id="nombre" size="15" value="<?php echo "";?>"/>
      </label>
    </td>
    <td>duracion</td>
    <td><label><input type="text" name="duracion" id="duracion"  size="10" value="<?php echo "";?>"  /></label></td>
    <td colspan="2"><input type="submit" name="buscar_responsable" id="buscar_responsable" value="Buscar responsable" /></td>
    <td><label><input id="down" type="button" name="down" onclick="__Nivel(0)" value="<--" /></label></td>
    <td><label>
    <select name="niveles" id="niveles" >
    <option value="" selected="selected"></option>
    <option>Nivel 1</option>
    <option>Nivel 2</option>
	<option>Nivel 3</option>        
    </select>
    </label></td>
    <td><label><input id="up" type="button" name="up" onclick="__Nivel(1)" value="-->"/></label></td>
    </tr>
  <tr>
    <td>responsable</td>
    <td><label>
      <input type="text" name="responsable" id="responsable" size="15" value="<?php echo "";?>" />
    </label><input name="user" type="hidden" value="<?php echo "";?>" id="user" /></td>
    <td>inicio</td>
    <td><label>
      <input type="text" name="inicio" id="inicio"  size="10" value="<?php echo "";?>"  />
    </label></td>
    <td colspan="2"><label>
      <input type="submit" name="info" id="info" value="Informacion detallada" />
    </label></td>
    <td colspan="3" rowspan="2">
      <label>
        <input type="radio" name="position" value="antes" id="position_0" />
        Antes de la</label>
      <br />
      <label>
        <input type="radio" name="position" value="despues" id="position_1" checked="checked" />
        Despues de la</label>
      <br />
    </td>
    </tr>
  <tr>
    <td>prioridad</td>
    <td><label>
      <input type="text" name="prioridad" id="prioridad" size="15" value="<?php echo "";?>" />
    </label></td>
    <td>final</td>
    <td><label>
      <input type="text" name="fin" id="fin"  size="10" value="<?php echo "";?>"  />
    </label></td>
    <td><input type="submit" name="guardar" id="guardar" value="Guardar" /></td>
    <td><input type="submit" name="eliminar" id="eliminar" value="Eliminar" /></td>
    </tr>
</table>
        </div>
        <div id="estructura" >
<?php if(isset($show) && $show)
	{  //echo $show;
		echo " <table width='600' border='0' >
			  <tr class='alternative'>
				<td>&nbsp;</td>
				<td>Nombre......................</td>
				<td>Nivel</td>
				<td>Inicio</td>
				<td>Fin</td>
				<td>Prioridad</td>
				<td colspan='2'>Opciones</td>
			  </tr>";
		//foreach($rows as $values){	  
		?>
		<tr>
        	<td></td>
            <td><?php echo $rows->nombre;?></td>
            <td><?php echo $rows->nivel;?></td>
            <td><?php echo $rows->inicio_programado;?></td>
            <td><?php echo $rows->fin_programado;?></td>
            <td><?php echo $rows->prioridad;?></td>
            <td></td>
            <td></td>
        </tr>
		<?php
	//	}
		//recursivo2($_POST["id_proyecto"], $conexion);
 	 echo "</table>";
	}?>
        </div>
</form>
</div>
<!-- Fin Contenido -->
        
        </div>
<!--Fin Contenedor-->
</div>
<?php if(isset($script) && $script){
	echo $script;
}
?>